


#include "slepdef.h"


/* Level 1 BLAS */

/* [dest = orig] */
void slep_dvcopy(slep_vector* orig, slep_vector* dest);
void slep_dmcopy(slep_matrix* orig, slep_matrix* dest);
slep_matrix* slepCopyToNewMatrix(slep_matrix* mtrx);
slep_vector* slepCopyToNewVector(slep_vector* vctr);

/* [x = alpha * x] */
void slep_dscal(double alpha, slep_vector* x);

/* [y = y + alpha * x] */
void slep_daxpy(double alpha, slep_vector* x, slep_vector* y);

/* [y = alpha * x + beta * y] */
void slep_daxpby(double alpha, slep_vector* x, double beta, slep_vector* y);

/* [= x.y] */
double slep_ddot(slep_vector* x, slep_vector* y);

/* [=sqrt(x.x)] */
double slep_dnrm2(slep_vector* x);

/* [=|x|_p (p-norm of x)] */
double slep_dpnrm(slep_vector* x, double p);

/* [=|x| (1-Norm)] */
double slep_dasum(slep_vector* x);

/* [=sum(x_i) (Sum of all elements of x)] */
double slep_dsum(slep_vector* x);

/* [=i such that |x_i| is maximum ] */
int slep_idamax(slep_vector* x);

/* [=|x_i| such that |x_i| is maximum ] */
double slep_damax(slep_vector* x);

/* [= x_i (such that x_i is maximum) ] */
double slep_dmax(slep_vector* x);


/* [=||A|| (Frobenius-Norm)] */
double slep_dfrbnrm(slep_matrix* a);

/* [= trace ( A` . B` ) [ ` = transposity] */
double slep_dtraceAB(slep_transposity transA, slep_matrix* a, slep_transposity transB, slep_matrix* b);

/* [y = x.diag(y) (or diag(x).y as both are same)] */
void slep_xdiagy(slep_vector* x, slep_vector* y);


/* [y = {diag(x)^-1}.y ] */
void slep_invdiagxy(slep_vector* x, slep_vector* y);





/* Level 2 BLAS */

/* [y = alpha.A`.x + beta.y] */
void slep_daAxpby(slep_transposity trans, double alpha,
				  slep_matrix* A, slep_vector* x,
				  double beta, slep_vector* y);


/* [x = A`.x (` implies SlepTranspose or SlepNoTranspose)]*/
void slep_dtrmv(slep_transposity trans,	slep_matrix* A,	slep_vector* x);

/* [x = {A`^(-1)} . x (` implies SlepTranspose or SlepNoTranspose)]*/
void slep_dtrsv(slep_transposity trans,	slep_matrix* A,	slep_vector* x);


void slep_dger(double alpha, slep_vector* x, slep_vector* y,
			   slep_matrix* A);

/* Level 3 BLAS */

void slep_dgemm(slep_transposity transA, slep_transposity transB, double alpha,
				slep_matrix* A, slep_matrix* B, double beta, slep_matrix* C);


void slep_dsymm(double alpha, slep_matrix* A, slep_matrix* B,
				double beta, slep_matrix* C);

void slep_dtrmm(slep_side side, slep_transposity transA, double alpha,
				slep_matrix* A, slep_matrix* B);


void slep_dtrsm(slep_side side, slep_transposity transA, double alpha,
				slep_matrix* A, slep_matrix* B);



/* Other useful functions */

void slep_zerom(slep_matrix *mtrx);
void slep_zerov(slep_vector *vctr);